package e

type Language int

var (
	LanguageType = Lan_Chinese
)

const (
	Lan_Chinese Language = iota
	Lan_English
)

var MsgFlags = map[int]map[Language]string{
	SUCCESS:             {Lan_English: "success", Lan_Chinese: "成功"},
	ERROR:               {Lan_English: "error", Lan_Chinese: "错误"},
	INVALID_PARAMS:      {Lan_English: "invalidParams", Lan_Chinese: "请求参数无效"},
	ERROR_ADD_USER_FAIL: {Lan_English: "addUserFail", Lan_Chinese: "添加用户失败"},
}

func GetMsg(errCode int) string {
	msg, ok := MsgFlags[errCode][LanguageType]
	if !ok {
		return MsgFlags[ERROR][LanguageType]
	}

	return msg
}
